package controllers

import (


)

// const url string = "https://openapi.alipay.com/gateway.do?"
const URL string = "https://openapi.alipaydev.com/gateway.do?"	//test 网关
const APPID string =	"2016082500309332"
const METHOD_CREATE string ="alipay.trade.precreate"
const SIGN_TYPE2 string = "RSA2"
const SIGN string = "sign"
const NOTIFY_URL string = "http://120.55.58.176:8080/aliPay"
 // 公钥和私钥可以从文件中读取
 var privateKey = []byte(`
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEA4GWkanKRujduRhx7fiZhjbuj4KKsV6Ftor52TJHTx7y2pqpgcngNQJq3nZSPXZaCcE
D/zUsny+LmPs2Cu+3iZF9VM3Uw2KbdeSOY9iVMUeYxfxiuze2t4x+9Qv4XA9SU1ddwuH9lObW/VXKbrZbx
6+iEeIzZM08jchwcmExp18dbZj7znxteRse1qBUEO9neMWybDMpSpBXf/zu5l8GsF2jcnrlAWiZ3TCor4G
t4ZxiF4MHO85XxeUHK990/2BH866eIlhOqP11lwbLufHns1BZeaOZB3bucWmTbmQq4ie6M4iAUvzbxsMEI
zCvySGW6yeiEqQ3i4Yd3XnIjbG3DiwIDAQABAoIBAHDCIpBq6deNKxiID3YgizzRYVPr6nZOY+03j/KCBM
2FgrLVQonC0cX4+PNyR2hbzUfjIadjcKf/aHt+gYc1zmFplkK5TMZRc1EAFkj6DRPKfGzFVnGcUZijxlL3
o1EFbZTXIYlUWuVY8sBZSuk7xG0q9gYtoKcryT/56FSPcVA/p/owsd1PQ0l6L3WrCghvbSbz58Kmjjs7Y1
Td2nLgGF9cpzFN7/zgdpl7o+HzcFKZDGOSOJMRxhscYhqa/EUuCu/Ejys+BCMntAEWXhztO6vSJUUn97EC
/yQp/XQ4d/slhPv/7sPNUnluNuf4Iy8lC3YRhjRiVIVLzetj1tKJnYECgYEA/CGPGmAIJ8iIIjD8uzrv9e
zjZTkazFUqDvpks0mfXXILxpF9awYiqizM3ujkj9KRnQEmUYdvjTAA92NLXBnkD6muVL+HjH89EtBBFjbW
cbZaGTXfcr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bhJpA9kd3GNJBFfsow2qNTlnjY/Fr4bWvd9YeDodUC+AUOaLYN6bqPqAxoZhq0u
2GotrhlohfZnepa5COgQKBgF/fQXQPG/h7+HBveroEp7hTBaY1XfkEr/vNG6oaPpmtRboEd/pb8lekTUGs
5RemHTBgcudDjsxT8H8tZYMhlkw9NtuqEMg4gVFo8riu3n1kQJc7SNhPEtKX0BIGFRbOJhTcMAyjVWykS1
jG3K7sqgLrsJ+owbhk16H07VyWC8kO`)
		
var publicKey = []byte(`
-----BEGIN PUBLICK KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4GWkanKRujduRhx7fiZhjbuj4KKsV6Ftor52TJH
Tx7y2pqpgcngNQJq3nZSPXZaCcED/zUsny+LmPs2Cu+3iZF9VM3Uw2KbdeSOY9iVMUeYxfxiuze2t4x+9Qv
4XA9SU1ddwuH9lObW/VXKbrZbx6+iEeIzZM08jchwcmExp18dbZj7znxteRse1qBUEO9neMWybDMpSpBXf/
zu5l8GsF2jcnrlAWiZ3TCor4Gt4ZxiF4MHO85XxeUHK990/2BH866eIlhOqP11lwbLufHns1BZeaOZB3buc
WmTbmQq4ie6M4iAUvzbxsMEIzCvySGW6yeiEqQ3i4Yd3XnIjbG3DiwIDAQAB
-----END PUBLICK KEY-----
`)

func AliPayClient(partnerId string) {
	// alipay := alipay.Client{
	// 	Partner   : APPID, // 合作者ID
	// 	Key       : string(PRIVATEKEY), // 合作者私钥
	// 	ReturnUrl : "", // 同步返回地址
	// 	NotifyUrl : NOTIFY_URL, // 网站异步返回地址
	// 	Email     : "121546320@qq.com", // 网站卖家邮箱地址
	// }
	// form := alipay.Form(alipay.Options{
	// 	OrderId:  "123",	// 唯一订单号
	// 	Fee:      99.8,		// 价格
	// 	NickName: "翱翔大空",	// 用户昵称，支付页面显示用
	// 	Subject:  "充值100",	// 支付描述，支付页面显示用
	// })
}



